
$.post("robot_findType.action", function (message) {
	$("#type").html(message);
});
function questions() {
	$("#showMessage").html("");
	var message = $("#question").val();
	var typeid = $("#typeid").val();
	if (typeid == "a") {
		alert("\u8bf7\u9009\u62e9\u7c7b\u578b");
		return;
	}
	if (message != "" && message != null) {
		var user = $("#user").val();
		if (user == "" || user == null) {
			user = "\u6e38\u5ba2";
		}
		var userMessage = "<div style='background-color: #ccc\t;display: block;'><font color=red>" + user + "</font>:&nbsp;&nbsp;" + message + "</div>";
		$.post("robot_find.action", {question:encodeURIComponent(message), typeid:typeid}, function (answer) {
			var robotmessage = "<br/>\u673a\u5668\u4eba :" + answer + "<br/>";
			$("#message").html($("#message").html() + userMessage + robotmessage);
			window.setTimeout("document.getElementById('message').scrollTop=document.getElementById('message').scrollHeight;",150);
		});
	}
	$("#question").val("");
	find();
}
function find() {
	if ($("#question").val().length >= 0) {
		var count = $("#count").html();
		if ($("#question").val().length > 30) {
			var str = $("#question").val();
			$("#question").val(str.substring(0, 30));
		} else {
			$("#count").html(30 - $("#question").val().length);
		}
	}
}
function finds() {
	$("#showMessage").html("");
	var message = $("#question").val();
	var typeid = $("#typeid").val();
	if (typeid != "a" && message != "") {
		$.post("robot_finds.action", {question:encodeURIComponent(message), typeid:typeid}, function (message) {
			$("#showMessage").css("width", "350px");
			$("#showMessage").css("z-index", "10");
			$("#showMessage").html(message);
		});
	} else {
		$("#showMessage").html("");
	}
}
function setMes(ms) {
	$("#question").val(ms);
	$("#showMessage").html("");
	find();
	questions();
}
function mover(tr) {
	tr.className = "mo";
}
function mout(tr) {
	tr.className = "ml";
}

